and use that to draw the image onto a drawable.
</para>
- <important>
- <para>
- Since these functions use GdkRGB for rendering, you must
- initialize GdkRGB before using any of them. You can do this by
- calling gdk_rgb_init() near the beginning of your program.
- </para>
- </important>
-
<!-- ##### SECTION ./tmpl/rendering.sgml:See_Also ##### -->
<para>
<SECTION>
<TITLE>GdkRGB</TITLE>
<FILE>rgb</FILE>
-gdk_rgb_init
<SUBSECTION>
gdk_draw_rgb_image
GdkRgbCmap
<SUBSECTION>
-gdk_rgb_gc_set_foreground
-gdk_rgb_gc_set_background
-gdk_rgb_xpixel_from_rgb
gdk_rgb_find_color
<SUBSECTION>
<!-- ##### SECTION Stability_Level ##### -->
-<!-- ##### FUNCTION gdk_rgb_init ##### -->
-<para>
-This function no longer does anything at all. It's completely useless
-(and harmless).
-</para>
-
-
-
<!-- ##### FUNCTION gdk_draw_rgb_image ##### -->
<para>
Draws an RGB image in the drawable. This is the core GdkRGB
@colors: The colors, represented as 0xRRGGBB integer values.
@n_colors: The number of colors in the cmap.
-<!-- ##### FUNCTION gdk_rgb_gc_set_foreground ##### -->
-<para>
-Sets the foreground color in @gc to the specified color (or the
-closest approximation, in the case of limited visuals).
-</para>
-
-@gc: The #GdkGC to modify.
-@rgb: The color, represented as a 0xRRGGBB integer value.
-
-
-<!-- ##### FUNCTION gdk_rgb_gc_set_background ##### -->
-<para>
-Sets the background color in @gc to the specified color (or the
-closest approximation, in the case of limited visuals).
-</para>
-
-@gc: The #GdkGC to modify.
-@rgb: The color, represented as a 0xRRGGBB integer value.
-
-
-<!-- ##### FUNCTION gdk_rgb_xpixel_from_rgb ##### -->
-<para>
-Finds the X pixel closest in color to the @rgb color specified. This
-value may be used to set the <structfield>pixel</structfield> field of
-a #GdkColor struct.
-</para>
-
-@rgb: The color, represented as a 0xRRGGBB integer value.
-@Returns: The X pixel value.
-
-
<!-- ##### FUNCTION gdk_rgb_find_color ##### -->
<para>
gdk_rgb_find_color
gdk_rgb_get_colormap
gdk_rgb_get_visual
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_rgb_init
-gdk_rgb_xpixel_from_rgb G_GNUC_CONST
-gdk_rgb_gc_set_background
-gdk_rgb_gc_set_foreground
-#endif
gdk_rgb_set_install
gdk_rgb_set_min_colors
gdk_rgb_set_verbose
return image_info;
}
-void
-gdk_rgb_init (void)
-{
- static const gint byte_order[1] = { 1 };
-
- /* check endian sanity */
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- if (((char *)byte_order)[0] == 1)
- g_error ("gdk_rgb_init: compiled for big endian, but this is a little endian machine.\n\n");
-#else
- if (((char *)byte_order)[0] != 1)
- g_error ("gdk_rgb_init: compiled for little endian, but this is a big endian machine.\n\n");
-#endif
-}
-
static GdkRgbInfo *
gdk_rgb_get_info_from_colormap (GdkColormap *cmap)
{
return pixel;
}
-/* convert an rgb value into an X pixel code */
-gulong
-gdk_rgb_xpixel_from_rgb (guint32 rgb)
-{
- guint32 r = rgb & 0xff0000;
- guint32 g = rgb & 0xff00;
- guint32 b = rgb & 0xff;
-
- return gdk_rgb_xpixel_from_rgb_internal (gdk_screen_get_rgb_colormap (gdk_screen_get_default ()),
- (r >> 8) + (r >> 16), g + (g >> 8), b + (b << 8));
-}
-
-void
-gdk_rgb_gc_set_foreground (GdkGC *gc, guint32 rgb)
-{
- GdkColor color;
-
- color.pixel = gdk_rgb_xpixel_from_rgb (rgb);
- gdk_gc_set_foreground (gc, &color);
-}
-
-void
-gdk_rgb_gc_set_background (GdkGC *gc, guint32 rgb)
-{
- GdkColor color;
-
- color.pixel = gdk_rgb_xpixel_from_rgb (rgb);
- gdk_gc_set_background (gc, &color);
-}
-
/**
* gdk_rgb_find_color:
* @colormap: a #GdkColormap
GSList *info_list;
};
-#ifndef GDK_DISABLE_DEPRECATED
-void gdk_rgb_init (void);
-
-gulong gdk_rgb_xpixel_from_rgb (guint32 rgb) G_GNUC_CONST;
-void gdk_rgb_gc_set_foreground (GdkGC *gc,
- guint32 rgb);
-void gdk_rgb_gc_set_background (GdkGC *gc,
- guint32 rgb);
-#define gdk_rgb_get_cmap gdk_rgb_get_colormap
-#endif /* GDK_DISABLE_DEPRECATED */
-
void gdk_rgb_find_color (GdkColormap *colormap,
GdkColor *color);